import axios from "./http";
import store from "../store";

// export const uploadUrl = 'http://up-z0.qiniu.com';
// export const uploadUrl = 'http://up-z1.qiniup.com';
export const uploadUrl = () => {
  return `/api/files/aliyunoss/upload.json?token=${store.state.token}&plat=web`
  // return `/api/files/aliyunoss/upload.json`
  // return `/api/files/aliyunoss/upload.json?token=c243fd100990fed4ef764c4ee890121f&plat=web`
};

export const getUploadToken = (filename) => {
  return axios
    .get(`/api/files/storage/ticket.json?name=${filename}&type=0`)
    .then((response) => {
      return response
    });
}
